package cly.thirdpartyconsumer.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 产业链物料表
 * @TableName cly_material
 */
@TableName(value ="cly_material")
@Data
public class ClyMaterial {
    /**
     * 物料id
     */
    private String materialid;

    /**
     * 物料名称
     */
    private String name;

    /**
     * 包装规格
     */
    private String def2;

    /**
     * 规格
     */
    private String materialspec;

    /**
     * 储存条件
     */
    private String bname;

    /**
     * 运输条件
     */
    private String conditions;

    /**
     * 单位
     */
    private String cname;

    /**
     * 数量
     */
    private BigDecimal quantity;

    /**
     * 单价
     */
    private BigDecimal price;

    /**
     * 供应商id
     */
    private BigDecimal supplierid;

    /**
     * 对比字段
     */
    private String fdlComparisonType;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createtime;

    /**
     * 更新时间

     */
    @TableField("update_time")
    private Date updatetime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ClyMaterial other = (ClyMaterial) that;
        return (this.getMaterialid() == null ? other.getMaterialid() == null : this.getMaterialid().equals(other.getMaterialid()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getDef2() == null ? other.getDef2() == null : this.getDef2().equals(other.getDef2()))
            && (this.getMaterialspec() == null ? other.getMaterialspec() == null : this.getMaterialspec().equals(other.getMaterialspec()))
            && (this.getBname() == null ? other.getBname() == null : this.getBname().equals(other.getBname()))
            && (this.getConditions() == null ? other.getConditions() == null : this.getConditions().equals(other.getConditions()))
            && (this.getCname() == null ? other.getCname() == null : this.getCname().equals(other.getCname()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getSupplierid() == null ? other.getSupplierid() == null : this.getSupplierid().equals(other.getSupplierid()))
            && (this.getFdlComparisonType() == null ? other.getFdlComparisonType() == null : this.getFdlComparisonType().equals(other.getFdlComparisonType()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMaterialid() == null) ? 0 : getMaterialid().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getDef2() == null) ? 0 : getDef2().hashCode());
        result = prime * result + ((getMaterialspec() == null) ? 0 : getMaterialspec().hashCode());
        result = prime * result + ((getBname() == null) ? 0 : getBname().hashCode());
        result = prime * result + ((getConditions() == null) ? 0 : getConditions().hashCode());
        result = prime * result + ((getCname() == null) ? 0 : getCname().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getSupplierid() == null) ? 0 : getSupplierid().hashCode());
        result = prime * result + ((getFdlComparisonType() == null) ? 0 : getFdlComparisonType().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", materialid=").append(materialid);
        sb.append(", name=").append(name);
        sb.append(", def2=").append(def2);
        sb.append(", materialspec=").append(materialspec);
        sb.append(", bname=").append(bname);
        sb.append(", conditions=").append(conditions);
        sb.append(", cname=").append(cname);
        sb.append(", quantity=").append(quantity);
        sb.append(", price=").append(price);
        sb.append(", supplierid=").append(supplierid);
        sb.append(", fdlComparisonType=").append(fdlComparisonType);
        sb.append(", createtime=").append(createtime);
        sb.append(", updatetime=").append(updatetime);
        sb.append("]");
        return sb.toString();
    }
}